﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebBanHang.GUI;
using System.Data.SqlClient;
using System.Data;
namespace WebBanHang
{
    public partial class Home : System.Web.UI.Page
    {
        public string Datestring;
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand( "Select * from DEAL where NgayKetThuc>=@NgayHienTai");
            SqlParameter[] pr = { new SqlParameter("@NgayHienTai", DateTime.Now.Date) };
            DataTable DATA = new DataTable();
            DATA = DataProvider.LoadTable(cmd, pr);
            dlDeal.DataSource = DATA;
            dlDeal.DataBind();            
            string format = "ddd MMM d yyyy HH:mm:ss";
            DateTime _TempDate = Convert.ToDateTime(DATA.Rows[0]["NgayKetThuc"]);
            Datestring = _TempDate.ToString(format);

        }
    }
}